package com.leorui.schoollife.controller.impl

import com.leorui.schoollife.entity.response.WeatherCommonResponse
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.ResponseBody

@Controller
class WeatherControllerImpl {
    @ResponseBody
    @PostMapping("/api/v1/pull_weather_report")
    fun pullWeatherReport(
            @RequestParam(name = "city_code") cityCode: String
    ): Map<Any?, Any?> {
        return WeatherCommonResponse
                .createResponse(0, "very good", 25, "提瓦特大陆", "${System.currentTimeMillis()}", "晴天")
                .toMap()
    }
}